package net.lzzy.tapDemo;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;
import java.util.List;

public class IndexRecordsTest {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setAppName("IndexRecordsTest").setMaster("local");
        JavaSparkContext jsc = new JavaSparkContext(conf);
        JavaRDD<String> javaRDD = jsc.textFile("E:\\Spark\\testDemo\\records.txt");
        JavaRDD<String> javaRDD1 = jsc.textFile("E:\\Spark\\testDemo\\recordsCityB.txt").union(javaRDD);
        JavaRDD<String> ak0803 = javaRDD1.filter(v1 -> v1.contains("AK0803"));
        List<String> collect = ak0803.collect();
        collect.forEach(s-> System.out.println(s));
    }
}
